# -*- coding: utf-8 -*-
# @Time    : 2020/11/18 9:14
# @Author  : DuJiabao
# @File    : detect_tflite.py
# @Description : 
import numpy as np
import cv2
from modelForTFLite import ModelForTFLite

if __name__ == '__main__':
    input_data = cv2.imread("8.png", cv2.IMREAD_GRAYSCALE).astype(np.float32)
    input_data = cv2.resize(input_data, (28, 28))
    input_data = np.expand_dims(input_data, 0)
    input_data = np.expand_dims(input_data, -1)

    model = ModelForTFLite("mnist_model.tflite")
    pred = model(input_data=input_data)

    print(np.argmax(pred))
